﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Separate.BLL.InfoForm
{
    public partial class NgInfoForm : Form
    {
        public NgInfoForm()
        {
            InitializeComponent();
        }

        private void NgInfoForm_Load(object sender, EventArgs e)
        {

        }
        public delegate void NgInfoLogDisDelegate(string info);
        private void NgInfoLogDis(string Info)
        {
            string newLine = DateTime.Now.ToString("HH:mm:ss") + ": " + Info  + Environment.NewLine;
            NgInfoRichTextBox.Text = NgInfoRichTextBox.Text.Insert(0, newLine);
        }
        public delegate void NgInfoFormDisDelegate(string info);
        private void NgInfoFormDis(string info)
        {
            NgInfoLogDisDelegate ngInfoLogDisDelegate = new NgInfoLogDisDelegate(NgInfoLogDis);
            this.Invoke(ngInfoLogDisDelegate, info);
        }


        public void NgLogDis(string info)
        {
            NgInfoFormDisDelegate ngInfoFormDisDelegate = new NgInfoFormDisDelegate(NgInfoFormDis);
            ngInfoFormDisDelegate.BeginInvoke(info, null, null);
        }
    }
}
